<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>兄弟节点</title>
		<script>
			function showEle(){
				let d=document.getElementById("d1");
				alert(d.firstElementChild.innerHTML);
				d.firstElementChild.innerHTML="王抗抗快学完了...";
				d.firstElementChild.nextElementSibling.innerHTML="王抗抗最自觉";
			
			}
		</script>
	</head>
	<body>
		<div id="d1">
			<h1>nodejs大家学到哪里了?</h1>
			<h2>自觉自律</h2>
			<h3>好习惯</h3>
		</div>
		<p>
			<button type="button" onclick="showEle()">获得元素</button>
		</p>
	</body>
</html>
